home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-01-24 | 26.0 KB | 938 lines | [TEXT/MPS ] |
- ;
- ; File: AppleEvents.a
- ;
- ; Contains: AppleEvent Package Interfaces.
- ;
- ; Version: Technology: System 7.5
- ; Package: Universal Interfaces 2.2 in “MPW” on ETO #20
- ;
- ; Copyright: © 1984-1995 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, use the Apple Bug Reporter
- ; stack. Include the file and version information (from above)
- ; in the problem description and send to:
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
- __APPLEEVENTS__ SET 1
-
-
- IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
- include 'Errors.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
-
- IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
- include 'Memory.a'
- ENDIF
- ; include 'MixedMode.a' ;
-
- IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
- include 'OSUtils.a'
- ENDIF
-
- IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
- include 'Events.a'
- ENDIF
- ; include 'Quickdraw.a' ;
- ; include 'QuickdrawText.a' ;
-
- IF &TYPE('__EPPC__') = 'UNDEFINED' THEN
- include 'EPPC.a'
- ENDIF
- ; include 'AppleTalk.a' ;
- ; include 'Files.a' ;
- ; include 'Finder.a' ;
- ; include 'PPCToolbox.a' ;
- ; include 'Processes.a' ;
-
- IF &TYPE('__NOTIFICATION__') = 'UNDEFINED' THEN
- include 'Notification.a'
- ENDIF
-
- ; Apple event descriptor types
- typeBoolean EQU 'bool'
- typeChar EQU 'TEXT'
- typeSMInt EQU 'shor'
- typeInteger EQU 'long'
- typeSMFloat EQU 'sing'
- typeFloat EQU 'doub'
- typeLongInteger EQU 'long'
- typeShortInteger EQU 'shor'
- typeLongFloat EQU 'doub'
- typeShortFloat EQU 'sing'
- typeExtended EQU 'exte'
- typeComp EQU 'comp'
- typeMagnitude EQU 'magn'
- typeAEList EQU 'list'
- typeAERecord EQU 'reco'
- typeAppleEvent EQU 'aevt'
- typeTrue EQU 'true'
- typeFalse EQU 'fals'
- typeAlias EQU 'alis'
- typeEnumerated EQU 'enum'
- typeType EQU 'type'
- typeAppParameters EQU 'appa'
- typeProperty EQU 'prop'
- typeFSS EQU 'fss '
- typeKeyword EQU 'keyw'
- typeSectionH EQU 'sect'
- typeWildCard EQU '****'
- typeApplSignature EQU 'sign'
- typeQDRectangle EQU 'qdrt'
- typeFixed EQU 'fixd'
- typeSessionID EQU 'ssid'
- typeTargetID EQU 'targ'
- typeProcessSerialNumber EQU 'psn '
- typeNull EQU 'null' ; null or nonexistent data
- ; Keywords for Apple event parameters
- keyDirectObject EQU '----'
- keyErrorNumber EQU 'errn'
- keyErrorString EQU 'errs'
- keyProcessSerialNumber EQU 'psn '
- ; Keywords for Apple event attributes
- keyTransactionIDAttr EQU 'tran'
- keyReturnIDAttr EQU 'rtid'
- keyEventClassAttr EQU 'evcl'
- keyEventIDAttr EQU 'evid'
- keyAddressAttr EQU 'addr'
- keyOptionalKeywordAttr EQU 'optk'
- keyTimeoutAttr EQU 'timo'
- keyInteractLevelAttr EQU 'inte' ; this attribute is read only - will be set in AESend
- keyEventSourceAttr EQU 'esrc' ; this attribute is read only
- keyMissedKeywordAttr EQU 'miss' ; this attribute is read only
- keyOriginalAddressAttr EQU 'from' ; new in 1.0.1
- ; Keywords for special handlers
- keyPreDispatch EQU 'phac' ; preHandler accessor call
- keySelectProc EQU 'selh' ; more selector call
- ; Keyword for recording
- keyAERecorderCount EQU 'recr' ; available only in vers 1.0.1 and greater
- ; Keyword for version information
- keyAEVersion EQU 'vers' ; available only in vers 1.0.1 and greater
- ; Event Class
- kCoreEventClass EQU 'aevt'
- ; Event ID’s
- kAEOpenApplication EQU 'oapp'
- kAEOpenDocuments EQU 'odoc'
- kAEPrintDocuments EQU 'pdoc'
- kAEQuitApplication EQU 'quit'
- kAEAnswer EQU 'ansr'
- kAEApplicationDied EQU 'obit'
-
- ; Constants for use in AESend mode
- kAENoReply EQU $00000001 ; sender doesn't want a reply to event
- kAEQueueReply EQU $00000002 ; sender wants a reply but won't wait
- kAEWaitReply EQU $00000003 ; sender wants a reply and will wait
- kAENeverInteract EQU $00000010 ; server should not interact with user
- kAECanInteract EQU $00000020 ; server may try to interact with user
- kAEAlwaysInteract EQU $00000030 ; server should always interact with user where appropriate
- kAECanSwitchLayer EQU $00000040 ; interaction may switch layer
- kAEDontReconnect EQU $00000080 ; don't reconnect if there is a sessClosedErr from PPCToolbox
- kAEWantReceipt EQU nReturnReceipt ; sender wants a receipt of message
- kAEDontRecord EQU $00001000 ; don't record this event - available only in vers 1.0.1 and greater
- kAEDontExecute EQU $00002000 ; don't send the event for recording - available only in vers 1.0.1 and greater
- ; Constants for the send priority in AESend
- kAENormalPriority EQU $00000000 ; post message at the end of the event queue
- kAEHighPriority EQU nAttnMsg ; post message at the front of the event queue
-
- ; Constants for recording
- kAEStartRecording EQU 'reca' ; available only in vers 1.0.1 and greater
- kAEStopRecording EQU 'recc' ; available only in vers 1.0.1 and greater
- kAENotifyStartRecording EQU 'rec1' ; available only in vers 1.0.1 and greater
- kAENotifyStopRecording EQU 'rec0' ; available only in vers 1.0.1 and greater
- kAENotifyRecording EQU 'recr'
-
- ; Constant for the returnID param of AECreateAppleEvent
- kAutoGenerateReturnID EQU -1 ; AECreateAppleEvent will generate a session-unique ID
- ; Constant for transaction ID’s
- kAnyTransactionID EQU 0 ; no transaction is in use
- ; Constants for timeout durations
- kAEDefaultTimeout EQU -1 ; timeout value determined by AEM
- kNoTimeOut EQU -2 ; wait until reply comes back, however long it takes
-
- ; Constants for AEResumeTheCurrentEvent
- kAENoDispatch EQU 0 ; dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch
- kAEUseStandardDispatch EQU $FFFFFFFF ; table, or one of these two constants
- ; Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch
- kAEDoNotIgnoreHandler EQU $00000000
- kAEIgnoreAppPhacHandler EQU $00000001 ; available only in vers 1.0.1 and greater
- kAEIgnoreAppEventHandler EQU $00000002 ; available only in vers 1.0.1 and greater
- kAEIgnoreSysPhacHandler EQU $00000004 ; available only in vers 1.0.1 and greater
- kAEIgnoreSysEventHandler EQU $00000008 ; available only in vers 1.0.1 and greater
- kAEIngoreBuiltInEventHandler EQU $00000010 ; available only in vers 1.0.1 and greater
- kAEDontDisposeOnResume EQU $80000000 ; available only in vers 1.0.1 and greater
-
- ; Apple event manager data types
- ; typedef FourCharCode AEEventClass
- ; typedef FourCharCode AEEventID
- ; typedef FourCharCode AEKeyword
- ; typedef ResType DescType
- AEDesc RECORD 0
- descriptorType ds.l 1 ; offset: $0 (0)
- dataHandle ds.l 1 ; offset: $4 (4)
- sizeof EQU * ; size: $8 (8)
- ENDR
-
- ; typedef struct AEDesc AEDesc
- AEKeyDesc RECORD 0
- descKey ds.l 1 ; offset: $0 (0)
- descContent ds AEDesc ; offset: $4 (4)
- sizeof EQU * ; size: $C (12)
- ENDR
-
- ; typedef struct AEKeyDesc AEKeyDesc
- ; an AEDesc which contains address data
- ; typedef AEDesc AEAddressDesc
- ; a list of AEDesc's is a special kind of AEDesc
- ; typedef AEDesc AEDescList
- ; AERecord is a list of keyworded AEDesc's
- ; typedef AEDescList AERecord
- ; an AERecord that contains an AppleEvent
- ; typedef AERecord AppleEvent
- ; typedef long AESendMode
- ; priority param of AESend
- ; typedef short AESendPriority
-
- kAEInteractWithSelf EQU 0
- kAEInteractWithLocal EQU 1
- kAEInteractWithAll EQU 2
-
- ; typedef SInt8 AEInteractAllowed
-
- kAEUnknownSource EQU 0
- kAEDirectCall EQU 1
- kAESameProcess EQU 2
- kAELocalProcess EQU 3
- kAERemoteProcess EQU 4
-
- ; typedef SInt8 AEEventSource
-
- kAEDataArray EQU 0
- kAEPackedArray EQU 1
- kAEHandleArray EQU 2
- kAEDescArray EQU 3
- kAEKeyDescArray EQU 4
-
- ; typedef SInt8 AEArrayType
- AEArrayData RECORD 0
- kAEDataArray ds.w 1 ; offset: $0 (0)
- ORG 0
- kAEPackedArray ds.b 1 ; offset: $0 (0)
- ORG 0
- kAEHandleArray ds.l 1 ; offset: $0 (0)
- ORG 0
- kAEDescArray ds AEDesc ; offset: $0 (0)
- ORG 0
- kAEKeyDescArray ds AEKeyDesc ; offset: $0 (0)
- ORG 12
- sizeof EQU * ; size: $C (12)
- ENDR
-
- ; typedef union AEArrayData AEArrayData
- ; typedef AEArrayData *AEArrayDataPointer
- ; typedef UniversalProcPtr AECoercionHandlerUPP
- ;*************************************************************************
- ; The following calls apply to any AEDesc. Every 'result' descriptor is
- ; created for you, so you will be responsible for memory management
- ; (including disposing) of the descriptors so created. Note: purgeable
- ; descriptor data is not supported - the AEM does not call LoadResource.
- ;*************************************************************************
- ;
- ; pascal OSErr AECreateDesc(DescType typeCode, const void *dataPtr, Size dataSize, AEDesc *result)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AECreateDesc
- move.w #$0825,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AECreateDesc
- ENDIF
-
- ;
- ; pascal OSErr AECoercePtr(DescType typeCode, const void *dataPtr, Size dataSize, DescType toType, AEDesc *result)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AECoercePtr
- move.w #$0A02,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AECoercePtr
- ENDIF
-
- ;
- ; pascal OSErr AECoerceDesc(const AEDesc *theAEDesc, DescType toType, AEDesc *result)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AECoerceDesc
- move.w #$0603,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AECoerceDesc
- ENDIF
-
- ;
- ; pascal OSErr AEDisposeDesc(AEDesc *theAEDesc)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEDisposeDesc
- move.w #$0204,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEDisposeDesc
- ENDIF
-
- ;
- ; pascal OSErr AEDuplicateDesc(const AEDesc *theAEDesc, AEDesc *result)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEDuplicateDesc
- move.w #$0405,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEDuplicateDesc
- ENDIF
-
- ;*************************************************************************
- ; The following calls apply to AEDescList. Since AEDescList is a subtype of
- ; AEDesc, the calls in the previous section can also be used for AEDescList.
- ; All list and array indices are 1-based. If the data was greater than
- ; maximumSize in the routines below, then actualSize will be greater than
- ; maximumSize, but only maximumSize bytes will actually be retrieved.
- ;*************************************************************************
- ;
- ; pascal OSErr AECreateList(const void *factoringPtr, Size factoredSize, Boolean isRecord, AEDescList *resultList)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AECreateList
- move.w #$0706,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AECreateList
- ENDIF
-
- ;
- ; pascal OSErr AECountItems(const AEDescList *theAEDescList, long *theCount)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AECountItems
- move.w #$0407,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AECountItems
- ENDIF
-
- ;
- ; pascal OSErr AEPutPtr(AEDescList *theAEDescList, long index, DescType typeCode, const void *dataPtr, Size dataSize)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEPutPtr
- move.w #$0A08,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEPutPtr
- ENDIF
-
- ;
- ; pascal OSErr AEPutDesc(AEDescList *theAEDescList, long index, const AEDesc *theAEDesc)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEPutDesc
- move.w #$0609,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEPutDesc
- ENDIF
-
- ;
- ; pascal OSErr AEGetNthPtr(const AEDescList *theAEDescList, long index, DescType desiredType, AEKeyword *theAEKeyword, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetNthPtr
- move.w #$100A,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetNthPtr
- ENDIF
-
- ;
- ; pascal OSErr AEGetNthDesc(const AEDescList *theAEDescList, long index, DescType desiredType, AEKeyword *theAEKeyword, AEDesc *result)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetNthDesc
- move.w #$0A0B,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetNthDesc
- ENDIF
-
- ;
- ; pascal OSErr AESizeOfNthItem(const AEDescList *theAEDescList, long index, DescType *typeCode, Size *dataSize)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AESizeOfNthItem
- move.w #$082A,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AESizeOfNthItem
- ENDIF
-
- ;
- ; pascal OSErr AEGetArray(const AEDescList *theAEDescList, AEArrayType arrayType, AEArrayDataPointer arrayPtr, Size maximumSize, DescType *itemType, Size *itemSize, long *itemCount)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetArray
- move.w #$0D0C,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetArray
- ENDIF
-
- ;
- ; pascal OSErr AEPutArray(AEDescList *theAEDescList, AEArrayType arrayType, const AEArrayData *arrayPtr, DescType itemType, Size itemSize, long itemCount)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEPutArray
- move.w #$0B0D,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEPutArray
- ENDIF
-
- ;
- ; pascal OSErr AEDeleteItem(AEDescList *theAEDescList, long index)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEDeleteItem
- move.w #$040E,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEDeleteItem
- ENDIF
-
- ;*************************************************************************
- ; The following calls apply to AERecord. Since AERecord is a subtype of
- ; AEDescList, the calls in the previous sections can also be used for
- ; AERecord an AERecord can be created by using AECreateList with isRecord
- ; set to true.
- ;*************************************************************************
- ;*************************************************************************
- ; The following calls are used to pack and unpack parameters from records
- ; of type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls
- ; in the previous sections can also be used for variables of type
- ; AppleEvent. The next six calls are in fact identical to the six calls
- ; for AERecord.
- ;*************************************************************************
- ;
- ; pascal OSErr AEPutParamPtr(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType typeCode, const void *dataPtr, Size dataSize)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEPutParamPtr
- move.w #$0A0F,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEPutParamPtr
- ENDIF
-
- ;
- ; pascal OSErr AEPutParamDesc(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, const AEDesc *theAEDesc)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEPutParamDesc
- move.w #$0610,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEPutParamDesc
- ENDIF
-
- ;
- ; pascal OSErr AEGetParamPtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetParamPtr
- move.w #$0E11,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetParamPtr
- ENDIF
-
- ;
- ; pascal OSErr AEGetParamDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, AEDesc *result)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetParamDesc
- move.w #$0812,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetParamDesc
- ENDIF
-
- ;
- ; pascal OSErr AESizeOfParam(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType *typeCode, Size *dataSize)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AESizeOfParam
- move.w #$0829,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AESizeOfParam
- ENDIF
-
- ;
- ; pascal OSErr AEDeleteParam(AppleEvent *theAppleEvent, AEKeyword theAEKeyword)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEDeleteParam
- move.w #$0413,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEDeleteParam
- ENDIF
-
- ;*************************************************************************
- ; The following calls also apply to type AppleEvent. Message attributes are
- ; far more restricted, and can only be accessed through the following 5
- ; calls. The various list and record routines cannot be used to access the
- ; attributes of an event.
- ;*************************************************************************
- ;
- ; pascal OSErr AEGetAttributePtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetAttributePtr
- move.w #$0E15,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetAttributePtr
- ENDIF
-
- ;
- ; pascal OSErr AEGetAttributeDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, AEDesc *result)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetAttributeDesc
- move.w #$0826,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetAttributeDesc
- ENDIF
-
- ;
- ; pascal OSErr AESizeOfAttribute(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType *typeCode, Size *dataSize)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AESizeOfAttribute
- move.w #$0828,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AESizeOfAttribute
- ENDIF
-
- ;
- ; pascal OSErr AEPutAttributePtr(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType typeCode, const void *dataPtr, Size dataSize)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEPutAttributePtr
- move.w #$0A16,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEPutAttributePtr
- ENDIF
-
- ;
- ; pascal OSErr AEPutAttributeDesc(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, const AEDesc *theAEDesc)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEPutAttributeDesc
- move.w #$0627,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEPutAttributeDesc
- ENDIF
-
- ;*************************************************************************
- ; The next couple of calls are basic routines used to create, send,
- ; and process AppleEvents.
- ;*************************************************************************
- ;
- ; pascal OSErr AECreateAppleEvent(AEEventClass theAEEventClass, AEEventID theAEEventID, const AEAddressDesc *target, short returnID, long transactionID, AppleEvent *result)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AECreateAppleEvent
- move.w #$0B14,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AECreateAppleEvent
- ENDIF
-
- ;
- ; pascal OSErr AESend(const AppleEvent *theAppleEvent, AppleEvent *reply, AESendMode sendMode, AESendPriority sendPriority, long timeOutInTicks, AEIdleUPP idleProc, AEFilterUPP filterProc)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AESend
- move.w #$0D17,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AESend
- ENDIF
-
- ;
- ; pascal OSErr AEProcessAppleEvent(const EventRecord *theEventRecord)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEProcessAppleEvent
- move.w #$021B,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEProcessAppleEvent
- ENDIF
-
- ;
- ; Note: during event processing, an event handler may realize that it is likely
- ; to exceed the client's timeout limit. Passing the reply to this
- ; routine causes a wait event to be generated that asks the client
- ; for more time.
- ;
- ;
- ; pascal OSErr AEResetTimer(const AppleEvent *reply)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEResetTimer
- move.w #$0219,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEResetTimer
- ENDIF
-
- ;*************************************************************************
- ; The following four calls are available for applications which need more
- ; sophisticated control over when and how events are processed. Applications
- ; which implement multi-session servers or which implement their own
- ; internal event queueing will probably be the major clients of these
- ; routines. They can be called from within a handler to prevent the AEM from
- ; disposing of the AppleEvent when the handler returns. They can be used to
- ; asynchronously process the event (as MacApp does).
- ;*************************************************************************
- ;
- ; pascal OSErr AESuspendTheCurrentEvent(const AppleEvent *theAppleEvent)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AESuspendTheCurrentEvent
- move.w #$022B,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AESuspendTheCurrentEvent
- ENDIF
-
- ;
- ; Note: The following routine tells the AppleEvent manager that processing
- ; is either about to resume or has been completed on a previously suspended
- ; event. The procPtr passed in as the dispatcher parameter will be called to
- ; attempt to redispatch the event. Several constants for the dispatcher
- ; parameter allow special behavior. They are:
- ; - kAEUseStandardDispatch means redispatch as if the event was just
- ; received, using the standard AppleEvent dispatch mechanism.
- ; - kAENoDispatch means ignore the parameter.
- ; Use this in the case where the event has been handled and no
- ; redispatch is needed.
- ; - non nil means call the routine which the dispatcher points to.
- ;
- ;
- ; pascal OSErr AEResumeTheCurrentEvent(const AppleEvent *theAppleEvent, const AppleEvent *reply, AEEventHandlerUPP dispatcher, long handlerRefcon)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEResumeTheCurrentEvent
- move.w #$0818,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEResumeTheCurrentEvent
- ENDIF
-
- ;
- ; pascal OSErr AEGetTheCurrentEvent(AppleEvent *theAppleEvent)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetTheCurrentEvent
- move.w #$021A,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetTheCurrentEvent
- ENDIF
-
- ;
- ; pascal OSErr AESetTheCurrentEvent(const AppleEvent *theAppleEvent)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AESetTheCurrentEvent
- move.w #$022C,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AESetTheCurrentEvent
- ENDIF
-
- ;*************************************************************************
- ; The following three calls are used to allow applications to behave
- ; courteously when a user interaction such as a dialog box is needed.
- ;*************************************************************************
- ;
- ; pascal OSErr AEGetInteractionAllowed(AEInteractAllowed *level)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetInteractionAllowed
- move.w #$021D,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetInteractionAllowed
- ENDIF
-
- ;
- ; pascal OSErr AESetInteractionAllowed(AEInteractAllowed level)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AESetInteractionAllowed
- move.w #$011E,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AESetInteractionAllowed
- ENDIF
-
- ;
- ; pascal OSErr AEInteractWithUser(long timeOutInTicks, NMRecPtr nmReqPtr, AEIdleUPP idleProc)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEInteractWithUser
- move.w #$061C,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEInteractWithUser
- ENDIF
-
- ;*************************************************************************
- ; These calls are used to set up and modify the event dispatch table.
- ;*************************************************************************
- ;
- ; pascal OSErr AEInstallEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP handler, long handlerRefcon, Boolean isSysHandler)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEInstallEventHandler
- move.w #$091F,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEInstallEventHandler
- ENDIF
-
- ;
- ; pascal OSErr AERemoveEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP handler, Boolean isSysHandler)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AERemoveEventHandler
- move.w #$0720,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AERemoveEventHandler
- ENDIF
-
- ;
- ; pascal OSErr AEGetEventHandler(AEEventClass theAEEventClass, AEEventID theAEEventID, AEEventHandlerUPP *handler, long *handlerRefcon, Boolean isSysHandler)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetEventHandler
- move.w #$0921,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetEventHandler
- ENDIF
-
- ;*************************************************************************
- ; These calls are used to set up and modify the coercion dispatch table.
- ;*************************************************************************
- ;
- ; pascal OSErr AEInstallCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP handler, long handlerRefcon, Boolean fromTypeIsDesc, Boolean isSysHandler)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEInstallCoercionHandler
- move.w #$0A22,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEInstallCoercionHandler
- ENDIF
-
- ;
- ; pascal OSErr AERemoveCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP handler, Boolean isSysHandler)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AERemoveCoercionHandler
- move.w #$0723,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AERemoveCoercionHandler
- ENDIF
-
- ;
- ; pascal OSErr AEGetCoercionHandler(DescType fromType, DescType toType, AECoercionHandlerUPP *handler, long *handlerRefcon, Boolean *fromTypeIsDesc, Boolean isSysHandler)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetCoercionHandler
- move.w #$0B24,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetCoercionHandler
- ENDIF
-
- ;*************************************************************************
- ; These calls are used to set up and modify special hooks into the
- ; AppleEvent manager.
- ;*************************************************************************
- ;
- ; pascal OSErr AEInstallSpecialHandler(AEKeyword functionClass, UniversalProcPtr handler, Boolean isSysHandler)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEInstallSpecialHandler
- move.w #$0500,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEInstallSpecialHandler
- ENDIF
-
- ;
- ; pascal OSErr AERemoveSpecialHandler(AEKeyword functionClass, UniversalProcPtr handler, Boolean isSysHandler)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AERemoveSpecialHandler
- move.w #$0501,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AERemoveSpecialHandler
- ENDIF
-
- ;
- ; pascal OSErr AEGetSpecialHandler(AEKeyword functionClass, UniversalProcPtr *handler, Boolean isSysHandler)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEGetSpecialHandler
- move.w #$052D,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEGetSpecialHandler
- ENDIF
-
- ;*************************************************************************
- ; This call was added in version 1.0.1. If called with the keyword
- ; keyAERecorderCount ('recr'), the number of recorders that are
- ; currently active is returned in 'result'.
- ;*************************************************************************
- ; available only in vers 1.0.1 and greater
- ;
- ; pascal OSErr AEManagerInfo(AEKeyword keyWord, long *result)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _AEManagerInfo
- move.w #$0441,d0
- dc.w $A816
- EndM
- ELSE
- IMPORT_CFM_FUNCTION AEManagerInfo
- ENDIF
-
- ENDIF ; __APPLEEVENTS__
-